<html>
<head><meta charset="utf-8"><title>TyKind::Dyn(...) encoding question · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/TyKind.3A.3ADyn(.2E.2E.2E).20encoding.20question.html">TyKind::Dyn(...) encoding question</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="241528269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/TyKind%3A%3ADyn%28...%29%20encoding%20question/near/241528269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/TyKind.3A.3ADyn(.2E.2E.2E).20encoding.20question.html#241528269">(Jun 04 2021 at 12:32)</a>:</h4>
<p>Am I correct in assuming that the list of <code>ExistentialPredicate</code>s in a <code>TyKind::Dyn(&lt;list of ExistentialPredicate&gt;, _)</code> can only contain a <code>ExistentialPredicate::Projection</code> if it also contains a principal trait (that requires such a projection predicate)? </p>
<p>E.g. that <code>&amp;'a dyn Iterator&lt;Item=u32&gt;</code> would map to <code>TyKind::Dyn([ExistentialPredicate::Trait(std::iter::Iterator), ExistentialPredicate::Projection(std::iter::Iterator::Item=u32)], 'a)</code>?</p>
<p>Reference: <a href="https://github.com/rust-lang/rust/blob/c4c2ab57a43737867982fafc8cfacd9b069fee96/compiler/rustc_middle/src/ty/sty.rs#L154">definition of TyKind::Dyn</a></p>



<a name="241532021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/TyKind%3A%3ADyn%28...%29%20encoding%20question/near/241532021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/TyKind.3A.3ADyn(.2E.2E.2E).20encoding.20question.html#241532021">(Jun 04 2021 at 13:07)</a>:</h4>
<p>Yes</p>



<a name="241542214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/TyKind%3A%3ADyn%28...%29%20encoding%20question/near/241542214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/TyKind.3A.3ADyn(.2E.2E.2E).20encoding.20question.html#241542214">(Jun 04 2021 at 14:20)</a>:</h4>
<p>Thank you, <span class="user-mention" data-user-id="232957">@Jack Huey</span> !</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>